// UserProfile data from the server - members/me result
var data;
// The collab ID for the collaborative recording for the chapter - chapterId
var RecordingCollabId;
var recordingCollabFlag:Boolean;

function init()
{
	Packages.modula.RequestCommand.request("HTTP", "restlet/members/me", null, null, "normal", this, {saved:"data", invokeCall:"invokeLoadFinish"});
}

function invokeLoadFinish()
{
	var tools:MovieClip=Packages.system.mlf.GateKeeper.scanElement("NavigationBar", "tools");
	Packages.system.mlf.GateKeeper.invoke(tools, "setClockTime", null);

	var date:Date=new Date();
	var unitHours:Number=date.getHours();
	var unitMinutes:Number=date.getMinutes();
	
	var welcomeWord:String=Packages.system.mlf.GateKeeper.scanDictionary(Packages.model.Context.messageBar, "WelcomeWord");
	var welwrdArr=welcomeWord.split("$");
	var greetings:String=data.nickName+welwrdArr[0]+unitHours+":"+unitMinutes+welwrdArr[1];

	Packages.modula.MessageCenter.send(greetings, 0);

	var lastLoginTime=Packages.system.mlf.GateKeeper.scanDictionary(Packages.model.Context.messageBar, "LastLoginTime");

	Packages.modula.MessageCenter.send(lastLoginTime+data.lastLoginTime, 2);
}

function handleResponseResult(rsp:Object)
{
	if (rsp.component.data.saved!=null)
	{
		this[rsp.component.data.saved]=rsp.service.result;
	}

	if (rsp.component.data.invokeCall!=null)
	{
		this[rsp.component.data.invokeCall].apply(this, rsp.component.data.invokeArgs);
	}
}